<template>
  <div class="brand">
    <div class="title">
      <h3>品牌制造商直供</h3>
    </div>
    <div class="content">
      <div class="item" v-for="item in brandList" :key="item.id" @click="toBranddetail(item.id)">
        <h4>{{item.name}}</h4>
        <p>{{item.floor_price | priceFilter}}</p>
        <img :src="item.pic_url" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    brandList: Array
  },
  
  methods: {
    toBranddetail(e) {
      this.$router.push("/branddetail/" + e);
    }
  }
};
</script>

<style lang="less" scoped>
.brand {
  margin-bottom: 5px;
  border-top: 10px solid #f4f4f4;
  .title {
    text-align: center;
    h3 {
      font-weight: normal;
    }
  }
  .content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    .item {
      width: 49.5%;
      margin-top: 5px;
      position: relative;
      img {
        width: 100%;
        height: 100%;
      }
      h4 {
        font-weight: normal;
        position: absolute;
        left: 5%;
        top: 10px;
        margin: 0;
      }
      p {
        font-weight: normal;
        position: absolute;
        left: 5%;
        top: 35px;
        margin: 0;
        color: #666;
        font-size: 14px;
      }
    }
  }
}
</style>